uni.addInterceptor('navigateTo', {
	invoke(e) {
		const token = uni.getStorageSync('token')
		if (!token && e.url !== '/pages/user/login/index') {
			uni.navigateTo({ url: '/pages/user/login/index' })
			return false
		}
		return true
	},
	fail: err => {
		console.log(err)
	}
})

uni.addInterceptor('navigateBack', {
	invoke(e) {
		const token = uni.getStorageSync('token')
		if (!token && e.url !== '/pages/user/login/index') {
			uni.navigateTo({ url: '/pages/user/login/index' })
			return false
		}
		return true
	},
	fail: err => {
		console.log(err)
	}
})